#!/bin/bash
version=$(wget -qO- -t1 -T2 "https://api.github.com/repos/Oreomeow/bili/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g;s/V//g')

wget -O "BILIBILI-HELPER.zip" "https://github.com/Oreomeow/bili/releases/download/${version}/BILIBILI-HELPER-${version}.zip"
mkdir "jar"
unzip -o "BILIBILI-HELPER.zip" -d "./jar/"
mv "./jar/BILIBILI-HELPER-${version}.jar" "./jar/BILIBILI-HELPER.jar" -f
rm "BILIBILI-HELPER.zip"

echo "下载完成"
